#pragma once 
#include <stdio.h>

#define SIZE 4096
#define NONE_FLUSH 1<<1
#define LINE_FLUSH 1<<2
#define FULL_FLUSH 1<<3

typedef struct my_file{
    int fileno;
    char buf[SIZE];
    size_t pos;
    size_t cap;
    int flush_mode;
}my_FILE;

void print_debug(my_FILE* stream);

my_FILE* my_fopen(const char *filename, const char *mode);

void my_fflush(my_FILE* stream);

size_t my_fwrite(const void* buf, size_t size, my_FILE* stream);

int my_fclose(my_FILE* stream);
